package com.dinzeer.legendreliclib.event;

// ... existing imports ...

import com.dinzeer.legendreliclib.lib.StackReg;
// 添加SMoveUtil导入
import com.dinzeer.legendreliclib.lib.key.SpecialTypeKeyEvent;
import com.dinzeer.legendreliclib.lib.util.text.AdvancedGradientTextHelper;
import com.dinzeer.legendreliclib.lib.util.text.ColorPreset;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

// 添加日志导入


// 示例事件处理器，演示如何使用堆栈系统
@Mod.EventBusSubscriber
public class Example {

    // 处理实体受伤事件
    @SubscribeEvent
    public static void LivingHurtEvent(LivingHurtEvent event) {
        if (event.getSource().getEntity() instanceof LivingEntity lv) {
           if (lv.getMainHandItem().getMaxStackSize() ==1){
            if (event.getSource().getEntity() instanceof Player player) {
                StackReg.COMBO_NUMBER.addStacks(player, 1);
                StackReg.LAST_DAMAGE.resetStacks(player);
                StackReg.LAST_DAMAGE.addStacks(player, (int) event.getAmount());
            }
            if (event.getEntity() instanceof Player player) {

                StackReg.COMBO_NUMBER.resetStacks(player);
            }
        }
        }
    }
    @SubscribeEvent
    public static void ToolTpTest(ItemTooltipEvent event) {
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.FLOW));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.STATIC));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.STATIC_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.STATIC_BOTTOM_UP));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.STATIC_TOP_DOWN));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.FLOW_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.PULSE));

//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE_REVERSE));
//        event.getToolTip().add(AdvancedGradientTextHelper.createGradientText("测试111111111", ColorPreset.RAINBOW, AdvancedGradientTextHelper.GradientMode.WAVE));
    }

//    @SubscribeEvent
//    public static void onSpecialKey1Pressed(SpecialTypeKeyEvent.SpecialTypeKey1PressedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键1按下"), true);
//    }
//
//    @SubscribeEvent
//    public static void onSpecialKey1Released(SpecialTypeKeyEvent.SpecialTypeKey1ReleasedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键1松开"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey2Pressed(SpecialTypeKeyEvent.SpecialTypeKey2PressedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键2按下"), true);
//    }
//
//    @SubscribeEvent
//    public static void onSpecialKey2Released(SpecialTypeKeyEvent.SpecialTypeKey2ReleasedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键2松开"), true);
//    }
//
//    @SubscribeEvent
//    public static void onSpecialKey3Pressed(SpecialTypeKeyEvent.SpecialTypeKey3PressedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键3按下"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey3Released(SpecialTypeKeyEvent.SpecialTypeKey3ReleasedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键3松开"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey4Pressed(SpecialTypeKeyEvent.SpecialTypeKey4PressedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键4按下"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey4Released(SpecialTypeKeyEvent.SpecialTypeKey4ReleasedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键4松开"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey6Pressed(SpecialTypeKeyEvent.SpecialTypeKey5PressedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键5按下"), true);
//    }
//    @SubscribeEvent
//    public static void onSpecialKey5Released(SpecialTypeKeyEvent.SpecialTypeKey5ReleasedEvent event) {
//        Player player = event.getEntity();
//        player.displayClientMessage(Component.literal("特殊按键5松开"), true);
//    }

}